package com.example.net;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeoutException;

import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.ParseException;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.params.CoreConnectionPNames;
import org.apache.http.protocol.HTTP;
import org.apache.http.util.EntityUtils;
import org.json.JSONException;
import org.json.JSONObject;

import com.example.huashangapp.HSApplication;
import com.example.service.MainService;
import com.example.ui.LoginActivity;
import com.example.ui.Userdata;
import com.example.ui.learn.ListeningActivity;
import com.example.ui.register.Register1Fm;

import com.example.ui.share.CreateCircleGroup;
import com.example.ui.share.CreateCircleGroupActivity;
import com.example.util.BitmapLoad;

import android.app.ListActivity;
import android.content.Context;
import android.net.ConnectivityManager;
import android.os.Looper;
import android.util.Log;
import net.tsz.afinal.FinalHttp;
import net.tsz.afinal.http.AjaxCallBack;
import net.tsz.afinal.http.AjaxParams;

public class NetRequest {

	private static String requestURL = Communication.BASEURL+ "/";// http://112.124.0.70:8088/huashangService
	public static String requesthttp = Communication.POINT;
	// 上传图片
	private static String requestPICURL = requestURL + "uploadCarte";
	// 圈子上传图片
	private static String circlerequestPICURL = "saveImage";
	// 图片地址
	public static String picURL = "", CirclepicURL = "", mobile = "";
	public static String pw = "";
	public static ArrayList<Userdata> la_ud = new ArrayList<Userdata>();
	private static String request_r2 = "sendcode?mobile=";
	private static String request_r3 = "sendcodeAgain?mobile=";
	private static String request_check_mobile = "checkmobile?mobile=";
	private static String request_item1 = "findCourseType?parentId=0";
	private static String request_ind = "findCourseType?parentId=89";
	private static String request_item2 = "showCourse?userId=";
	private static String request_item4 = "findViewType";
	private static String request_faq = "selectQuestion";
	private static String request_faqlike = "selectKeyword?keyword=";
	private static String request_circleNearby = "selectAllCommunity";
	private static String request_circleMy = "selectMyCommunity?uid=";
	private static String request_circleHot = "selectHootCommunity";
	private static String request_province = "selectProvince";
	private static String request_city = "selectCity?father=";
	private static String select_member = "selectMember?";
	private static String request_Collet="isintro";
	public static boolean isOpenNetwork(Context c) {  
	    ConnectivityManager connManager = (ConnectivityManager)c.getSystemService(Context.CONNECTIVITY_SERVICE);  
	    if(connManager.getActiveNetworkInfo() != null) {  
	        return connManager.getActiveNetworkInfo().isAvailable();  
	    }  
	  
	    return false;  
	}
	public static  String getData(String url) throws TimeoutException{
		String data="";
		try {
			HttpPost request = new HttpPost(url);
			request.getParams().setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 10000);
			request.getParams().setParameter(CoreConnectionPNames.SO_TIMEOUT, 10000);
			HttpResponse res = new DefaultHttpClient().execute(request);
			if (res.getStatusLine().getStatusCode() == 200) {
				try {
					data = EntityUtils.toString(res.getEntity(), "UTF-8");
				} catch (ParseException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}catch (ClientProtocolException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		} catch (IOException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		if(data==null){
			data="";
		}
		return data;
	}
	// 首页中间图片
		public static String getIndexImg() {
			String data = "";
			String url = requestURL + "begain";
			try {
				data=getData(url);
			} catch (TimeoutException e) {
				e.printStackTrace();
			}
			Log.i("index centerimg", url);
			return data;
		}
	// 查询圈子成员
	public static String getCircleMember(String circleId, String uid) {
		String data = "";
		String url = requestURL + select_member + "id=" + circleId + "&userId="
				+ uid;
		try {
			data=getData(url);
		} catch (TimeoutException e) {
			e.printStackTrace();
		}
		return data;
	}
	
		public static String onListenCheck(String courseid, int videoid) {
			String data = "";
			String url = requestURL +"saveVideo?courseid="+courseid+"&videoid="+videoid
					+"&userid="+HSApplication.sp.getString("userid","").toString()+"&typeId=0";	
			Log.i("on listen check", url);
			try {
				data=getData(url);
			} catch (TimeoutException e) {
				e.printStackTrace();
			}
			return data;
		}
	

	// 上传图片
	public static void uploadPic(final Context context, String path) {

		AjaxParams params = new AjaxParams();
		try {
			params.put("upload", new File(path));

		} catch (Exception e) {

			e.printStackTrace();
		}
		FinalHttp fh = new FinalHttp();

		fh.post(requestPICURL, params, new AjaxCallBack<String>() {
			@Override
			public void onLoading(long count, long current) {

			}

			@Override
			public void onSuccess(String t) {

				JSONObject jsonObject;
				try {
					jsonObject = new JSONObject(t);
					String response = jsonObject.getString("response");

					picURL = response;
					Register1Fm.photoPath=response;
					Register1Fm.handler.sendEmptyMessage(0);
					

				} catch (JSONException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}

			}

			@Override
			public void onFailure(Throwable t, String strMsg) {
				Register1Fm.handler.sendEmptyMessage(1);
				
			}

		});

	}

	// 上传图片
	public static void CircleuploadPic(final Context context, String path) {

		AjaxParams params = new AjaxParams();
		try {
			params.put("upload", new File(path));

		} catch (Exception e) {

			e.printStackTrace();
		}
		FinalHttp fh = new FinalHttp();
		Looper.prepare();
		fh.post(requestURL + circlerequestPICURL, params,
				new AjaxCallBack<String>() {
					@Override
					public void onLoading(long count, long current) {

					}

					@Override
					public void onSuccess(String t) {

						JSONObject jsonObject;
						try {
							jsonObject = new JSONObject(t);
							String response = jsonObject.getString("response");

							CirclepicURL = response;// Communication.POINT+
							if (!circlerequestPICURL.equals("")) {
								CreateCircleGroupActivity.path = CirclepicURL;
							}

						} catch (JSONException e) {
							// TODO Auto-generated catch block
							e.printStackTrace();
						}

					}

					@Override
					public void onFailure(Throwable t, String strMsg) {

					}

				});
		Looper.loop();
	}
	public static String Request_register4ind(){
		String data = "";
		String url = "";
		url = requestURL +request_ind;
		Log.i("industry", url);
		try {
			data=getData(url);
		} catch (TimeoutException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return data;
	}

	public static String postRequestCity(String provinceID) {
		String data = "";
		String url = "";
		url = requestURL + request_city + provinceID;
		try {
			data=getData(url);
		} catch (TimeoutException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return data;
	}

	public static String postRequestProvince() {
		String data = "";
		String url = "";
		url = requestURL + request_province;
		try {
			data=getData(url);
		} catch (TimeoutException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		Log.i("select province", url);
		return data;
	}

	//创建圈子
	public static String postRequestCreateCircle(List<String> list) {
		String data = "";
		String url = requestURL + "makeCommunity";

		HttpPost request = new HttpPost(url);
		List<NameValuePair> params = new ArrayList<NameValuePair>();
		params.add(new BasicNameValuePair("uid", list.get(0)));
		params.add(new BasicNameValuePair("title", list.get(1)));
		params.add(new BasicNameValuePair("intro", list.get(2)));
		params.add(new BasicNameValuePair("type", list.get(3)));
		params.add(new BasicNameValuePair("provinceId", list.get(4)));
		params.add(new BasicNameValuePair("cityId", list.get(5)));
		params.add(new BasicNameValuePair("shareType", list.get(6)));
		params.add(new BasicNameValuePair("joinType", list.get(7)));
		params.add(new BasicNameValuePair("thumb", list.get(8)));

		try {
			request.setEntity(new UrlEncodedFormEntity(params, HTTP.UTF_8));
			HttpResponse res = new DefaultHttpClient().execute(request);

			if (res.getStatusLine().getStatusCode() == 200) {
				data = EntityUtils.toString(res.getEntity(), "UTF-8");
			}
		} catch (Exception e) {

		}
		return data;
	}
	//更新圈子
		public static String postRequestUpdateCircle(List<String> list) {
			String data = "";
			String url = requestURL + "makeCommunity";

			HttpPost request = new HttpPost(url);
			List<NameValuePair> params = new ArrayList<NameValuePair>();
			params.add(new BasicNameValuePair("uid", list.get(0)));
			params.add(new BasicNameValuePair("title", list.get(1)));
			params.add(new BasicNameValuePair("intro", list.get(2)));
			params.add(new BasicNameValuePair("type", list.get(3)));
			params.add(new BasicNameValuePair("provinceId", list.get(4)));
			params.add(new BasicNameValuePair("cityId", list.get(5)));
			params.add(new BasicNameValuePair("shareType", list.get(6)));
			params.add(new BasicNameValuePair("joinType", list.get(7)));
			params.add(new BasicNameValuePair("thumb", list.get(8)));

			try {
				request.setEntity(new UrlEncodedFormEntity(params, HTTP.UTF_8));
				HttpResponse res = new DefaultHttpClient().execute(request);

				if (res.getStatusLine().getStatusCode() == 200) {
					data = EntityUtils.toString(res.getEntity(), "UTF-8");
				}
			} catch (Exception e) {

			}
			return data;
		}

	public static String postRequestCircleAll() {
		String data = "";
		String url = requestURL + request_circleNearby;
		try {
			data=getData(url);
		} catch (TimeoutException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return data;
	}

	public static String postRequestCircleMy() {
		String data = "";
		String url = requestURL + request_circleMy
				+ HSApplication.sp.getString("userid","").toString();// la_ud.get(0).getUserId();
		try {
			data=getData(url);
		} catch (TimeoutException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return data;
	}

	public static String postRequestCircleHot() {
		String data = "";
		String url = "";
		url = requestURL + request_circleHot;
		try {
			data=getData(url);
		} catch (TimeoutException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return data;
	}

	public static String postRequestFAQlike(String like) {
		String data = "";
		String url = "";
		url = requestURL + request_faqlike + like;
		try {
			data=getData(url);
		} catch (TimeoutException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return data;
	}

	public static String postRequestFAQ() {
		String data = "";
		String url = "";
		url = requestURL + request_faq;
		try {
			data=getData(url);
		} catch (TimeoutException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return data;
	}

	public static String postRequestFeedback(String typeid, String content) {
		String data = "";
		String url = requestURL + "saveFeedBook";
		
		HttpPost request = new HttpPost(url);
		List<NameValuePair> params = new ArrayList<NameValuePair>();
		params.add(new BasicNameValuePair("userid",HSApplication.sp.getString("userid","").toString()));
		params.add(new BasicNameValuePair("content", content));
		params.add(new BasicNameValuePair("typeid",typeid));
		try {
			request.setEntity(new UrlEncodedFormEntity(params, HTTP.UTF_8));
			HttpResponse res = new DefaultHttpClient().execute(request);
			if (res.getStatusLine().getStatusCode() == 200) {
				data = EntityUtils.toString(res.getEntity(), "UTF-8");
			}
		} catch (Exception e) {

		}
     
	
		return data;
	}

	public static String postRequestChangePassword(String pwd, String newPwd) {
		String data = "";
		String url = requestURL + "updatePwd?pwd=" + pwd + "&mobile="
				+HSApplication.sp.getString("mobile","").toString() + "&pwdNew1="
				+ newPwd;
		
       Log.i("change password", url);
		try {
			data=getData(url);
		} catch (TimeoutException e) {
			data="";
			e.printStackTrace();
		}
		return data;
	}

	public static String postRequestVisit(List<String> list) {
		String data = "";
		String url = requestURL + "saveVisit?userId="
				+ HSApplication.sp.getString("userid","").toString()
				+ "&interviewId="+list.get(0)+"&interviewName=" + list.get(1)
				+ "&interviewTime=" + list.get(2) + "&interviewAddress="
				+ list.get(3) + "&interviewContent=" + list.get(4)
				+ "&userCompany=" + list.get(5) + "&userAddress=" + list.get(6)
				+ "&userName=" + list.get(7) + "&userPhone=" + list.get(8)
				+ "&userEmail=" + list.get(9) + "&userHomephone=" + list.get(10);
		try {
			data=getData(url);
		} catch (TimeoutException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return data;
	}

	public static String postRequestinvite(List<String> list) {
		String data = "";
		String url = requestURL + "saveTraining";
		HttpPost request = new HttpPost(url);
		List<NameValuePair> params = new ArrayList<NameValuePair>();
		params.add(new BasicNameValuePair("userid", HSApplication.sp.getString("userid","").toString()));
		params.add(new BasicNameValuePair("title", list.get(0)));
		params.add(new BasicNameValuePair("expertid", list.get(1)));
		params.add(new BasicNameValuePair("expert", list.get(2)));
		params.add(new BasicNameValuePair("trainingTime", list.get(3)));	
		params.add(new BasicNameValuePair("onlinetime", list.get(4)));
		params.add(new BasicNameValuePair("trainnumber", list.get(5)));		
		params.add(new BasicNameValuePair("company", list.get(6)));
		params.add(new BasicNameValuePair("address", list.get(7)));
		params.add(new BasicNameValuePair("username", list.get(8)));
		params.add(new BasicNameValuePair("mobilephone", list.get(9)));
		params.add(new BasicNameValuePair("email", list.get(10)));
		params.add(new BasicNameValuePair("tellphone", list.get(11)));
		try {
			request.setEntity(new UrlEncodedFormEntity(params, HTTP.UTF_8));
			HttpResponse res = new DefaultHttpClient().execute(request);
			if (res.getStatusLine().getStatusCode() == 200) {
				data = EntityUtils.toString(res.getEntity(), "UTF-8");
			}
		} catch (Exception e) {

		}
		return data;
	}

	public static String postRequestStart(List<String> list) {
		String data = "";
		String url = requestURL + "saveActives";
		HttpPost request = new HttpPost(url);
		List<NameValuePair> params = new ArrayList<NameValuePair>();
		params.add(new BasicNameValuePair("userId",HSApplication.sp.getString("userid","").toString()));
		params.add(new BasicNameValuePair("title", list.get(0)));
		params.add(new BasicNameValuePair("typeId", list.get(1)));

		params.add(new BasicNameValuePair("timeline", list.get(3)));
		params.add(new BasicNameValuePair("place", list.get(4)));
		params.add(new BasicNameValuePair("price", list.get(5)));
		params.add(new BasicNameValuePair("companyName", list.get(6)));
		params.add(new BasicNameValuePair("address", list.get(7)));
		params.add(new BasicNameValuePair("name", list.get(8)));
		params.add(new BasicNameValuePair("phone", list.get(9)));
		params.add(new BasicNameValuePair("email", list.get(10)));
		params.add(new BasicNameValuePair("homephone", list.get(11)));

		try {
			request.setEntity(new UrlEncodedFormEntity(params, HTTP.UTF_8));
			HttpResponse res = new DefaultHttpClient().execute(request);
			if (res.getStatusLine().getStatusCode() == 200) {
				data = EntityUtils.toString(res.getEntity(), "UTF-8");
			}
		} catch (Exception e) {

		}
		return data;
	}

	public static String Request_Item04() {

		String data = null;
		String url = requestURL + request_item4;
		try {
			data=getData(url);
		} catch (TimeoutException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return data;

	}

	public static String Request_sra(String id) {
		String data = null;
		String url = requestURL + "findViewRecord?id=" + id;
		Log.i("hs recommend", url);
		try {
			data=getData(url);
		} catch (TimeoutException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return data;

	}

	public static String Request_RecommendCourse( int num,String id,String terId) {

		String request1 = "activityInfo?id="+terId+"&bId="+id;
		String request2 = "courseInfo?id="+terId+"&bId="+id;
		String req;
		String data = null;
		switch (num) {
		case 1:
			req = request1;
			break;
		case 0:
			req = request2;
			break;
		default:
			req="";
			break;
		}
		
		String url = requestURL + req;
          Log.i("detail", url);		
 
		try {
			data=getData(url);
		} catch (TimeoutException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return data;

	}

	public static String Request_Recommend(String id,int type) {
		String data = null;
		String url = requestURL + "recommendCourse?id=" + id+"&type="+type;
		try {
			data=getData(url);
		} catch (TimeoutException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		Log.i("recommend",url);
		return data;

	}
	public static String Request_allActivity(int type) {

		String data = null;

		String url = requestURL + "offlineActives?type="+type;
		Log.i("item 03", url);
		try {
			data=getData(url);
		} catch (TimeoutException e) {
			e.printStackTrace();
		}
		return data;

	}

	public static String Request_listen2(String id) {

		String data = null;

		String url = requestURL + "findMyView?id=" + id + "&userid="
				+ HSApplication.sp.getString("userid","").toString();
		Log.i("listen", url);
		ListeningActivity.itemUrl=url;
		try {
			data=getData(url);
			Log.i("hsft","华商访谈的数据"+data);
		} catch (TimeoutException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return data;

	}

	public static String Request_listen(String id) {

		String data = null;

		String url = requestURL + "selectVideo?id=" + id + "&userid="
				+ HSApplication.sp.getString("userid","").toString();
		Log.i("listen", url);
		ListeningActivity.itemUrl=url;
		try {
			data=getData(url);
		} catch (TimeoutException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return data;
	}

	public static String Request_login(String user, String pwd) {

		String pushid = "1";// Leone add 1代表Android客户端
		String userId = HSApplication.getInstance().getSpUtil().getUserId();// 百度推送用户id
																			// 1133753378624444944
		String data = null;
		String url = requestURL + "login?mobile=" + user + "&pwd=" + pwd
				+ "&TokenType=" + pushid + "&Token=" + userId;

		try {
			data=getData(url);
		} catch (TimeoutException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return data;

	}

	public static void getuserdata(String data) {
		JSONObject j;
		try {
			j = new JSONObject(data);
			String result = j.getString("response");
			if (result.equals("true")) {
				la_ud = AnalyzingJson.getdata_login(data);
			}
		} catch (JSONException e) {

			e.printStackTrace();
		}
	}

	public static String Request_Item02() {

		String data = null;
		String url = requestURL + request_item2
				+ HSApplication.sp.getString("userid","").toString();
		try {
			data=getData(url);
		} catch (TimeoutException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return data;

	}

	public static String Request_hsaitemclick(String typeid) {
		String data = null;
		String url = requestURL + "selectInfo?id=" + typeid;
		try {
			data=getData(url);
		} catch (TimeoutException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		return data;
	}

	public static String Request_addCourse(String courseId) {
		String data = null;
		String url = requestURL + "saveCourse?userId="
				+ HSApplication.sp.getString("userid","").toString() + "&videoId="
				+ courseId;
		try {
			data=getData(url);
		} catch (TimeoutException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		return data;
	}

	public static String Request_deleteCourse(String courseId) {
		String data = null;
		String url = requestURL + "deleteCourse?userId=&videoId="
				+ HSApplication.sp.getString("userid","").toString() + "&videoId="
				+ courseId;
		try {
			data=getData(url);
		} catch (TimeoutException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		return data;
	}

	public static String Request_Item01() {

		String data = null;
		String url = requestURL + request_item1;
		try {
			data=getData(url);
		} catch (TimeoutException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return data;

	}

	public static String Request_ia(String id) {
		String data = null;
		String url = requestURL + "goTraining?id=" + id + "&userid="
				+ HSApplication.sp.getString("userid","").toString();
		Log.i("invite ", url);
		try {
			data=getData(url);
		} catch (TimeoutException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return data;

	}

	// xuanke second view
	public static String Request_cca(String id) {
		String data = null;
		
		String url = requestURL + "findCourse?id=" + id + "&userId="
				+ HSApplication.sp.getString("userid","").toString();
        Log.i("center2", url);
		try {
			data=getData(url);
		} catch (TimeoutException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return data;

	}

	// hstalk second view
	public static String Request_hta(String id) {
		String data = null;
		String url = requestURL + "findView?id=" + id;		
		Log.i("url", url);
		try {
			data=getData(url);
		} catch (TimeoutException e) {
			e.printStackTrace();
		}
		return data;
	}

	// 上传所有用户注册信息
	public static String postRequest(List<String> list) {
		String data = "";
		String url = requestURL + "register";
		HttpPost request = new HttpPost(url);
		List<NameValuePair> params = new ArrayList<NameValuePair>();
		params.add(new BasicNameValuePair("photo", picURL));
		params.add(new BasicNameValuePair("username", list.get(0)));
		params.add(new BasicNameValuePair("gender", list.get(1)));
		params.add(new BasicNameValuePair("province", list.get(2)));
		params.add(new BasicNameValuePair("city", list.get(3)));
		params.add(new BasicNameValuePair("company", list.get(4)));
		params.add(new BasicNameValuePair("zhiwu", list.get(5)));
		params.add(new BasicNameValuePair("occupation", list.get(6)));
		params.add(new BasicNameValuePair("pwd", list.get(7)));
		params.add(new BasicNameValuePair("mobile", mobile));
		
		try {
			request.setEntity(new UrlEncodedFormEntity(params, HTTP.UTF_8));
			HttpResponse res = new DefaultHttpClient().execute(request);
			
			if (res.getStatusLine().getStatusCode() == 200) {
				data = EntityUtils.toString(res.getEntity(), "UTF-8");
				Log.i("data", data);
			}
		} catch (Exception e) {
		}
		return data;
	}

	// 获取验证码验证
	public static String postRequest2(String value) {

		String data = "";

		String url = requestURL + request_r2 + value;
		mobile = value;

		try {
			data=getData(url);
		} catch (TimeoutException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return data;
	}
	// 验证手机号码是否注册
		public static String checkMobile(String value) {

			String data = "";

			String url = requestURL + request_check_mobile + value;
			try {
				data=getData(url);
			} catch (TimeoutException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			return data;
		}

	// 验证验证码
	public static String postRequest3( String phone, String code) {
		String data = "";
		String url = requestURL + "getcode?mobile=" + phone + "&code=" + code;
		try {
			data=getData(url);
		} catch (TimeoutException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}		
		return data;
	}
	
	//判断指定的音频是否被收藏
	public static String Request_CheckCollet(String id ,String userid) {
			String data = "";
			String url = requestURL +request_Collet+"?userId="+userid+"&videoId="+id;
			try {
				data=getData(url);
			} catch (TimeoutException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			return data;
	}
	public static String postRequest2Again(String tellphone) {
		String data = "";
		String url = requestURL + request_r3 + tellphone;
		mobile = tellphone;
		try {
			data=getData(url);
		} catch (TimeoutException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return data;
	}

}
